
import DailyTaskSystem from "../system/DailyTaskSystem";
import Util from "../../../StartAb/Util";
import { ITask } from "./ITask";

export class TaskUseHints extends ITask {
    _cnt: number = 0;

    constructor(cnt: number, rewardCoin: number) {
        super();
        this._cnt = cnt;
        this._rewardCoin = rewardCoin;
    }

    description() {
        // return i18n.t("hintusefmt");
        return Util.stringFormat(Util.getMulLangText("hintusefmt"), this._cnt) 
    }

    isDone(): boolean {
        return DailyTaskSystem.dailyInfo.todayUseHintCount >= this._cnt;
    }

    progressString(): string {
        return Math.min(this._cnt, DailyTaskSystem.dailyInfo.todayUseHintCount) + "/" + this._cnt;
    }

    progressPercent(): number {
        return Math.min(DailyTaskSystem.dailyInfo.todayUseHintCount / this._cnt, 1.0);
    }
    
    toComplete(): void {
        DailyTaskSystem.goToPlayGame()
    }
}